/**
 * 支付成功提醒页面
 */
Ext.define("PRO.shop.view.pay.payHintView",{
    extend: 'Ext.panel.Panel',
    border:0,
    layout:'fit',
    alias: 'widget.shop.payhintview',
    autoScroll : true,
    initComponent: function(){
        var me = this;
        me.items=[{
             xtype:"panel",
             layout:"column",
             border:0,
             items:[{
                xtype:'box',
                columnWidth:1,
                height:120,
                width:60,
                html:'<i class="jeicon '+me.info.class+'"></i>'
             },{
                xtype:'box',
                columnWidth:1,
                html:"<p style='font-size: 20px;text-align:center;font-weight:bold;'>"+me.info.text+"</p>"
             },
             {
                xtype:'button',
                columnWidth:.7,
                style:'margin:30px 0 0 62px;',
                cls:'btn JEPLUS_B_L10',
                text:'关闭',
                handler:function(btn){
                   me.setActivePanel();
                   btn.up('window').close();
                }
             },
            ]
        }];
        me.callParent(arguments);
    },
    setActivePanel:function(){
      var me = this;
      //如果是充值页面
      var card = Ext.getCmp('shopMainEnterPanel').getCmp('cardPanel');
      
      if(card.winType){
        //关闭不需要激活面板
        return
      }else{
        //如果是其他情况，则需要激活面板
        Ext.getCmp('shopPayStyleView')?Ext.getCmp('shopPayStyleView').up('window').hide():'';
        Ext.getCmp('shopPayView')?(Ext.getCmp('shopPayView').up('window')?Ext.getCmp('shopPayView').up('window').hide():''):'';
        //设置激活面板为已购产品
        var window = Ext.create('PRO.shop.view.shopbuy.shopBuyView', {
            itemId:'buy'
        });
        var northPanel = card.previousNode();
        northPanel.getSelectionModel().select(northPanel.store.getAt(1));
       //无论有没有此面板，都要新添加
        if(!JE.isNotEmpty(card.getCmp('buy'))){
          card.add(window);
        }else{
          card.remove(card.getCmp('buy'));
          card.add(window);
        }
        card.getLayout().setActiveItem('buy');
      }
  }
});        